﻿using Microsoft.Win32.TaskScheduler;

namespace TSMonitor.Core
{
	public class TaskRunner
	{
		public void RunTask(TaskInfo taskInfo)
		{
			using(var service = new TaskService(taskInfo.ServerInfo.TargetServer))
			{
				var task = service.FindTask(taskInfo.Name);
				if(task != null)
				{
					task.Run();	
				}
			}
		}
	}
}